package com.android.camera2.common.ui;

import android.graphics.Bitmap;
import android.util.Size;
import android.view.SurfaceHolder;

import com.android.camera2.common.utils.CameraParameter;

public interface IAppUi {
    //lifecycle
    void init();

    void resume();

    void pause();

    void destroy();

    //MySurfacePreviewCallback
    interface PreviewSurfaceCallback {

        void onSurfaceCreate(SurfaceHolder holder);

        void onSurfaceChanged(SurfaceHolder holder, int format, int width, int height);

        void onSurfaceDestroyed(SurfaceHolder holder);
    }

    void setPrevSurfaceListener(SurfaceHolder.Callback callback);

    void setPreviewSize(Size size);

    //shutter
    interface ShutterListener {
        void onShutterLongPressed();

        void onShutterPressed();
    }

    void setShutterListener(ShutterListener listener);

    //camera switch
    interface CameraSwitchListener {
        void onCameraSwitch();
    }

    void setCameraSwitcherListener(CameraSwitchListener listener);

    void displayThumbnail(Bitmap b);

    //flash listener
    interface FlashStateListener {
        void flashOn();

        void flashOff();

        void flashAuto();

        void flashTroch();
    }

    void setFlashStateListener(FlashStateListener flashStateListener);

    //focus
    FocusView getFocusView();
    MySurfaceView getPreviewSurface();
    CoverView getCoverView();

    interface SingleTapListener {
        void onSingleTap(float x, float y);

        void onLongSingleTap(float x, float y);

        void resetTouchToFocus();
    }

    void setSingleTapLister(SingleTapListener singleTapListener);

    //ratio listener
    interface RatioListener {
        void ratio_1_1();

        void ratio_4_3();

        void ratio_16_9();

        void ratio_full();
    }

    //onRatioChanged
    void setRatioListener(RatioListener ratioListener);

    interface ModuleChagedLisener{
        void onModuleChanged(CameraParameter.MODE mode);
    }

    void setOnModuleChangedListener(ModuleChagedLisener listener);
}
